
public class Node {

	private Node right;
	private Node left;
	private char data;
	private int occurances;
	private String encoding;
	private boolean isLeaf;
	
	public Node(char data)
	{
		this.data = data;
	}
	
	public void setRight( Node right){
		this.right = right;
	}
	
	public void setLeft( Node left){
		this.left = left;
	}
	
	public Node getRight(){
		return right;
	}
	
	public Node getLeft(){
		return left;
	}

	public char getData() {
		return data;
	}

	public void setData(char data) {
		this.data = data;
	}

	public int getOccurances() {
		return occurances;
	}

	public void setOccurances(int occuruances) {
		this.occurances = occuruances;
	}

	public String getEncoding() {
		return encoding;
	}

	public void setEncoding(String encoding) {
		this.encoding = encoding;
	}
	
	public boolean equals(Node node)
	{
		return data == node.getData();
	}
	
	public int compareTo(Node node)
	{
		return data - node.getData();
	}

	public boolean isLeaf() {
		return isLeaf;
	}

	public void setLeaf(boolean isLeaf) {
		this.isLeaf = isLeaf;
	}

}
